package com.fitbet.entity.bet;

import java.util.Date;

import javax.persistence.EnumType;
import javax.persistence.Enumerated;
/**
 * 
 * @author sjh
 *
 */
public class BetComponent {
	
    /** 大赌局 id */
    private Long betId;
    
    /**
     * 小赌局 id
     */
    private Long userBetId;
	
	/**
	 * 图片
	 */
	private String avatar;
	
	/**
	 * 赌局名称
	 */
	private String name;

	/**
	 * 开始时间呢
	 */
	private Date startTime;

	/**
	 * 结束时间
	 */
	private Date endTime;

	/**
	 * 状态
	 */
	@Enumerated(EnumType.ORDINAL)
	private BetStatus status;

	/**
	 * 奖金池
	 */
	private int bonus;
	
	/**
	 * 大赌局赢的奖金
	 */
	private int betResult;
	
	/**
	 * 看好人数
	 */
	private int thumbup;
	
	/**
	 * 不被看好人数
	 */
	private int  thumbdown;
	
	
	/**
	 * The default constructor
	 */
	public BetComponent() {
		
	}

	/**
	 * 
	 * @param userBet
	 */
	public BetComponent(UserBet userBet) {
	    this.userBetId = userBet.getId();
	    this.betId = userBet.getBet().getId();
	    this.avatar = userBet.getBet().getAvatar();
	    this.name = userBet.getBet().getName();
	    this.startTime = userBet.getBet().getStartDate();
	    this.endTime = userBet.getBet().getEndDate();
	    this.status = userBet.getBet().getStatus();
	    this.bonus = userBet.getBet().getBonus();
	    this.betResult = userBet.getBetResult();
	    this.thumbup = userBet.getThumbup();
	    this.thumbdown = userBet.getThumbdown();
	    
	}
	
	/**
	 * 
	 * @param bet
	 */
	public BetComponent(Bet bet) {
		this.betId = bet.getId();
		this.avatar = bet.getAvatar();
		this.bonus = bet.getBonus();
		this.startTime = bet.getStartDate();
		this.endTime = bet.getEndDate();
		this.status = bet.getStatus();
	}
	
	/**
	 * 
	 * @param userBetSupport
	 */
	public BetComponent(UserBetSupport userBetSupport) {
		this.userBetId = userBetSupport.getUserBet().getId();
		this.betId = userBetSupport.getBet().getId();
		this.avatar = userBetSupport.getBet().getAvatar();
		this.name = userBetSupport.getBet().getName();
		this.startTime = userBetSupport.getBet().getStartDate();
		this.endTime = userBetSupport.getBet().getEndDate();
		this.status = userBetSupport.getBet().getStatus();
		this.bonus = userBetSupport.getBet().getBonus();
		this.betResult = userBetSupport.getUserBet().getBetResult();
		this.thumbup = userBetSupport.getUserBet().getThumbup();
		this.thumbdown = userBetSupport.getUserBet().getThumbdown();
	}
	
	
	
	/**
     * @return the userBetId
     */
    public Long getUserBetId() {
        return userBetId;
    }
    
    /**
     * @return the betId
     */
    public Long getBetId() {
        return betId;
    }

	/**
	 * @return the avatar
	 */
	public String getAvatar() {
		return avatar;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the startTime
	 */
	public Date getStartTime() {
		return startTime;
	}

	/**
	 * @return the endTime
	 */
	public Date getEndTime() {
		return endTime;
	}

	/**
	 * @return the status
	 */
	public BetStatus getStatus() {
		return status;
	}

	/**
	 * @return the bonus
	 */
	public int getBonus() {
		return bonus;
	}

	/**
	 * @return the betResult
	 */
	public int getBetResult() {
		return betResult;
	}

	/**
	 * @return the thumbup
	 */
	public int getThumbup() {
		return thumbup;
	}

	/**
	 * @return the thumbdown
	 */
	public int getThumbdown() {
		return thumbdown;
	}

	/**
     * @param userBetId the userBetId to set
     */
    public void setUserBetId(Long userBetId) {
        this.userBetId = userBetId;
    }
	
    /**
     * @param betId the betId to set
     */
    public void setBetId(Long betId) {
        this.betId = betId;
    }
	
	/**
	 * @param avatar the avatar to set
	 */
	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @param startTime the startTime to set
	 */
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	/**
	 * @param endTime the endTime to set
	 */
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(BetStatus status) {
		this.status = status;
	}

	/**
	 * @param bonus the bonus to set
	 */
	public void setBonus(int bonus) {
		this.bonus = bonus;
	}

	/**
	 * @param betResult the betResult to set
	 */
	public void setBetResult(int betResult) {
		this.betResult = betResult;
	}

	/**
	 * @param thumbup the thumbup to set
	 */
	public void setThumbup(int thumbup) {
		this.thumbup = thumbup;
	}

	/**
	 * @param thumbdown the thumbdown to set
	 */
	public void setThumbdown(int thumbdown) {
		this.thumbdown = thumbdown;
	}
	

}
